package com.boang.obj;

import java.util.Objects;

/*
  @author: 13813
  @date: 2024/11/22 14:03
*/
public class ObjectDemo extends Object {
    public static void main(String[] args) {
        Student s01 = new Student("张三");
        Student s02 = new Student("张三");

        /*
           问题：
           1.为什么s01对象可以调用equals()方法，因为Student的父类Object类中

         */
//        System.out.println(s01.equals(s02));

        String name01 = "张三";
        String name02 = "张三";
//        System.out.println(name01.equals(name02));

        //com.boang.obj.Student@bd308
//        System.out.println(s01.toString());

//        System.out.println(name01.toString());

        //每个对象的hashCode值是不一样的
//        System.out.println(s01.hashCode());
//        System.out.println(s02.hashCode());

        if(!Objects.isNull(s01)){
            System.out.println(Objects.isNull(s01));
        }
    }
}
